{extend name="common/main"}

{block name="css"}
<style>
    .lai{
        float: none;
        display:inline-block;
    }
</style>
{/block}

{block name="body"}
<body data-type="widgets">
{include file="common/index"}
<!-- 内容区域 -->
<div class="tpl-content-wrapper">
    <div class="row-content am-cf">


        <div class="row">

            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <!--<h3>充值卡转让</h3>-->
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title  am-cf">充值卡转让</div>
                    </div>
                    <div class="widget-body am-fr">

                        <form class="am-form tpl-form-border-form tpl-form-border-br " >

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">转入登陆账号: </label>
                                <div class="am-u-sm-3" id="lai">
                                    <input type="text" id="user-weibo" placeholder="请输入转入登陆账号">
                                </div>
                                <button type="button" class="am-btn am-btn-primary am-radius button_jc" style=" padding: .3em 1em;">检测</button>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">转入用户名:</label>
                                <div class="am-u-sm-3 lai" >
                                    <input type="text" id="user_name"  disabled="true">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">选择充值卡类型: </label>
                                <div class="am-u-sm-3 lai" >
                                    <label> <input type="radio" class="tpl-form-input" value="1" name="state" checked="checked">年卡</label>
                                    <label> <input type="radio" class="tpl-form-input" value="0" name="state">终身卡</label>
                                    <label> <input type="radio" class="tpl-form-input" value="0" name="state">月卡</label>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">输入充值卡张数: </label>
                                <div class="am-u-sm-3 lai" >
                                    <input type="text" id="weibo" placeholder="输入充值卡张数:">
                                </div>
                            </div>
                            <button type="button"  onclick="sub_butt(this)" class="am-btn am-btn-primary am-radius" style=" padding: .3em 1em;">确定</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
</div>
</body>
{/block}

{block name="js"}

<script type="text/javascript">
    $(function () {
        $('.button_jc').click(function () {
            $inpu=$(this).siblings('#lai').find('input').val();

            $.post("{:url('detection')}", {user_name:$inpu}, function(ret){
                if(ret.code != 200){
                    layer.msg(ret.msg, {icon: 2});
                    return false;
                }
                $('#user_name').val(ret.data);

            });
        })
    });
    function sub_butt(t) {
        $sum=$('#weibo').val();//转让点数

        $.post("{:url('presenter')}", {user_name:$sum}, function(ret){
            if(ret.code != 200){
                layer.msg(ret.msg, {icon: 2});
                return false;
            }
            //成功
            // $('#user_name').val(ret.data);

        });
    }

</script>
{/block}